package com.zq.common.util;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by system.out on 2017/3/13.
 */
public class ClassUtils {

    public static List<String> getAllField(Class clazz){
        if(clazz==null){
            return null;
        }
        List<String> field = new ArrayList<>();
        Field[] fields = clazz.getDeclaredFields();
        for (Field m : fields) {
            m.setAccessible(true);
            if("serialVersionUID".equals(m.getName())){
                continue;
            }
            field.add(m.getName());
        }
        return field;
    }
}
